package com.taobao.txc.common.c;

import io.netty.buffer.ByteBuf;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

public class g
  extends a
{
  List<Long> c = new ArrayList();
  List<Long> d = new ArrayList();
  
  public g()
  {
    this(1024);
  }
  
  public g(int paramInt)
  {
    this.b = ByteBuffer.allocate(paramInt);
  }
  
  public void a(List<Long> paramList)
  {
    this.c = paramList;
  }
  
  public void b(List<Long> paramList)
  {
    this.d = paramList;
  }
  
  public String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder("BranchCommitResultMessage ");
    if (this.d.size() > 0) {
      localStringBuilder.append(this.d.get(0)).append("...");
    }
    localStringBuilder.append(" result:").append(this.a).toString();
    return localStringBuilder.toString();
  }
  
  public short b_()
  {
    return 4;
  }
  
  public byte[] c()
  {
    if (this.c.size() > 32)
    {
      i = this.c.size();
      i = i / 64 + 2;
      this.b = ByteBuffer.allocate(i * 1024);
    }
    super.c();
    this.b.putInt(this.c.size());
    for (int i = 0; i < this.c.size(); i++)
    {
      this.b.putLong(((Long)this.c.get(i)).longValue());
      this.b.putLong(((Long)this.d.get(i)).longValue());
    }
    this.b.flip();
    byte[] arrayOfByte = new byte[this.b.limit()];
    this.b.get(arrayOfByte);
    return arrayOfByte;
  }
  
  public boolean a(ByteBuf paramByteBuf)
  {
    if (!super.a(paramByteBuf)) {
      return false;
    }
    int i = paramByteBuf.readableBytes();
    if (i < 4) {
      return false;
    }
    i -= 4;
    int j = paramByteBuf.readInt();
    if (i < 16 * j) {
      return false;
    }
    i -= 16 * j;
    for (int k = 0; k < j; k++)
    {
      this.c.add(Long.valueOf(paramByteBuf.readLong()));
      this.d.add(Long.valueOf(paramByteBuf.readLong()));
    }
    return true;
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.common.c.g
 * JD-Core Version:    0.7.0.1
 */